/*
 * @Author: your name
 * @Date: 2020-09-07 18:25:48
 * @LastEditTime: 2020-12-12 20:06:08
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /frontend-spiders/src/request.ts
 */
import axios from 'axios'

const instance = axios.create({
  baseURL: '/',
})

instance.interceptors.request.use(
  (config) => {
    // token
    config.headers['tg-token'] = '03fa2fb6d3e95f7c516b8c3426897a1c'
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

instance.interceptors.response.use((response) => {
  return response.data
})

export default instance
